package com.tencet.service.Impl;

import com.tencet.dao.AccountOneDAO;
import com.tencet.dao.impl.AccountOneDAOImpl;
import com.tencet.entity.AccountOne;
import com.tencet.service.AccountOneService;

import java.util.List;

/**
 * @author: Fame
 * @date: 2022-07-20 21:00
 * @description:
 */
public class AccountOneServiceImpl implements AccountOneService {
    private AccountOneDAO accountOneDAO = new AccountOneDAOImpl();
    @Override
    public List<AccountOne> getAccountOneList(String idTwo) {
        List<AccountOne> AccountOneList = accountOneDAO.getAccountOnrByIdTwo(idTwo);
        return AccountOneList;
    }

    @Override
    public Integer getBalance(String idOne) {
        return accountOneDAO.getBalanceByIdOne(idOne);
    }

    /**
     * @author Yangjx
     * @param id 绑卡关系的uuid
     * @param cardNum 一类卡号
     * @param card2id 二类卡号
     * @return 影响行数
     */
    @Override
    public int addCard(String id, String cardNum, String card2id) {
        return accountOneDAO.insert(id,cardNum,card2id);
    }
}
